package mySemantic;

public class ErrorPrint {
    //未定义变量使用
    public static void varNotDefined(String id, String type)
    {
        System.out.println("ESO1 >> " + type + " : " + id + " is not defined");
    }
    //变量重复定义
    public static void varDefinedAgain(String id, String type)
    {
        System.out.println("ES02 >> " + type + " : " + id + " is defined again");
    }
    //break语句未在循环中使用
    public static void breakNotInLoopStat()
    {
        System.out.println("ES03 >> " + "break is not used in loop statement");
    }
    //函数调用的参数个数和类型不匹配
    public static void paramsNotMatched(String id, String reason)
    {
        System.out.println("ESO4 >> " + "params: " + reason + " not matched when call function " + id);
    }

    //操作数不相容
    public static void operateNumNotMatched(String op)
    {
        System.out.println("ESO5 >> " + "The type of: \'"+ op + "\' is not matched");
    }

    //goto label 不存在
    public static void gotoLableNotExist(String label)
    {
        System.out.println("ESO7 >> " + "The label \'"+ label + "\' is not Exist");
    }

    //函数是否以return结束
    public static void funcNotEndWithReturn(String id)
    {
        System.out.println("ESO8 >> " + "function" + id + " not end with return");
    }

    //return不在函数中
    public static void returnStatNotInFunction()
    {
        System.out.println("ESO9 >>" + "retrun statement not in function");
    }

    //return 和 函数声明的返回不一致
    public static void returnTypeNotMatchFuncDefine(String funcName)
    {
        System.out.println("ES09 >>" + "The return type of " + funcName + " is different with its define" );
    }

    //数组元素获取时下标不是整数
    public static void arrayAccessNotInteger(String arrName)
    {
        System.out.println("ES10 >>" + "The array " + arrName + " access operation is not Integer" );
    }
}
